# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Contributor: travisghansen <travisghansen@yahoo.com>
# Contributor: aleiphoenix <aleiphoenix@gmail.com>

pkgname=librabbitmq-c
pkgver=0.11.0
pkgrel=2
pkgdesc='RabbitMQ(amqp) library written in C-language'
url='https://github.com/alanxz/rabbitmq-c'
arch=('loong64' 'x86_64')
license=('MIT')
depends=('popt' 'openssl')
makedepends=('cmake' 'docbook-xsl' 'doxygen' 'xmlto' 'ninja')
source=("${url}/archive/v${pkgver}/${pkgname}-${pkgver}.tar.gz")
sha512sums=('0c3dbb6e2b862e9f25e3f76df798ea272bbd81de2865950b95adf1f1e5791eb20d7c9d5a76cb7d2fda54bad5f12bdf69cbfa7e9fd1afdede6f9ec729ca2287de')
b2sums=('dce862d132d4bca010dbc284957f34a35d55407ea0eb4fb79369f699207c01cc7ed64c1bd58bea2d1178bd2c02176c3e93b66177fc975175b1da9ab9baaf661f')

build() {
  cd ${pkgname:3}-$pkgver
  cmake \
    -B build \
    -G Ninja \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_INSTALL_LIBDIR=lib \
    -DBUILD_EXAMPLES=OFF \
    -DBUILD_TOOLS=ON \
    -DBUILD_TOOLS_DOCS=ON \
    -DBUILD_TESTS=OFF \
    -DENABLE_SSL_SUPPORT=ON \
    -DBUILD_API_DOCS=ON \
    -Wno-dev
  ninja -C build -v
}

package() {
  cd ${pkgname:3}-$pkgver
  DESTDIR="${pkgdir}" ninja -C build install
  install -Dm 644 LICENSE-MIT -t "${pkgdir}"/usr/share/licenses/${pkgname}
}

# vim: ts=2 sw=2 et:
